<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<html>
<head>
	<meta name="decorator" content="moduleView" />
	<link href="${staticPath}/lib/datetimepicker/0.0.11/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css">
	<link href="${staticPath}/lib/chosen/1.1.0/chosen.min.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function getUrl(url){ 
	  $("#versionFrame").attr("src",url);
	}
$(document).ready(function() {
	$('[data-accounting]').each(function (){
		var $this = $(this);
		if($this.attr("data-accounting-precision") && ""!=$this.attr("data-accounting-precision")){
			$this.html(accounting.formatMoney($this.attr("data-accounting"),"¥ ",$this.attr("data-accounting-precision")*1));
		}else{
			$this.html(accounting.formatMoney($this.attr("data-accounting"),"¥ "));
		}
	});
});
function _confirm(){
	var item = confirm("是否确认要通知供应商,此异常有误!");
	if(item){
		$.ajax({
			type: "POST",
			url: "${contextPath}/biz/statement/statementSalesErro/exceptionError",
			data:{ "id":$("#errorId").val()},
			success: function(json) {
				var jsonObj =eval('(' + json + ')');
				if(jsonObj.success){
					$("#exceptionError").hide();
					$("#erroScheme").hide();
					$("#unConfirmed").text("异常有误,等待供应商再次确认");
					alert("发送成功!");
					
				}
			}
		});
	}
}
</script>
</head>
<body>
	<input type="hidden" id="errorId" value="${statementSelfrunError.id}">
	<div class="panel panel-default"> 
		<div class="col-xs-12 panel-heading">
			  <span class="panel-title o-v-action pull-left" id="span">
			    	自营对账异常单详细信息   
		    </span>
			    <h3 class="panel-title o-v-action">
	    		<a class="btn btn-default btn-sm pull-right o-a-button" role="button" href="${contextPath}/biz/statement/statementSelfrunError/list">返回</a>&nbsp&nbsp&nbsp&nbsp
	    		<a class="btn btn-danger btn-sm pull-right o-a-button" role="button" id="exceptionError"onclick="_confirm()">异常不存在</a>
	    		<a class="btn btn-success btn-sm pull-right o-a-button" role="button" id="erroScheme" href="${contextPath}/biz/statement/statementSelfrunError/${statementSelfrunError.id}/erroScheme">处理方案</a>			    
			    </h3>
		  </div>
	  <div>
		   <ul class="nav nav-tabs" id="myTab">
		
			</ul> 
			<div class="tab-content">
			  <div class="tab-pane active" id="home">
			  <tags:message content="${message}"/>
				  	<table class="table table-bordered">
					  <tbody>
					  	<tr>
					  		<td class="text-right" style="width: 20%"><strong>是否确认:</strong></td>
					  		<td id="unConfirmed"><ossp:value dictType="IS_CONFIRMED" key="${statementSelfrunError.isConfirmed}"></ossp:value></td>		
					  	</tr>
					  	<tr>
					  		<td class="text-right"><strong>提出日期:</strong></td>
					  		<td><fmt:formatDate value="${statementSelfrunError.createTime}" pattern="yyyy-MM-dd"/></td>
					  	</tr>
					  	<tr>
					  		<td class="text-right"><strong>单据日期:</strong></td>
					  		<td><fmt:formatDate value="${statementSelfrunError.saleDate}" pattern="yyyy-MM-dd"/></td>
					  	</tr> 
					  	<tr>
					  		<td class="text-right"><strong>自营单据单号:</strong></td>
					  		<td>${statementSelfrunError.billNo}"</td>
					  	</tr> 
					  	<tr>
					  		<td class="text-right"><strong>自营单据类型:</strong></td>
					  		<td>${statementSelfrunError.billType}</td>
					  	</tr> 
					  	<tr>
					  		<td class="text-right"><strong>供应商编号:</strong></td>
					  		<td>${statementSelfrunError.supplierNo}</td>
					  	</tr>
					  	<tr>
					  		<td class="text-right"><strong>供应商名称:</strong></td>
					  		<td>${statementSelfrunError.supplierName}</td>
					  	</tr>
					  	<tr>
					  		<td class="text-right"><strong>商品条码:</strong></td>
					  		<td>${statementSelfrunError.barCode}</td>
					  	</tr>  
					  	<tr>
					  		<td class="text-right"><strong>有误数量:</strong></td>
					  		<td >${statementSelfrunError.errorNumber}</td>
					  	</tr>
					  	<tr>
					  		<td class="text-right"><strong>实际数量:</strong></td>
					  		<td>${statementSelfrunError.actualNumber}</td>
					  	</tr>
					  	<tr>
					  		<td class="text-right"><strong>有误单价:</strong></td>
					  		<td data-accounting="${statementSelfrunError.errorPrice}" data-accounting-precision="4"></td>
					  		
					  	</tr>
					  	<tr>
					  		<td class="text-right"><strong>实际单价:</strong></td>
					  		<td data-accounting="${statementReceiveDetail.actualPrice}" data-accounting-precision="4" ></td>
					  	</tr>
					  	<tr>
					  		<td class="text-right"><strong>有误金额:</strong></td>
					  		<td data-accounting="${statementSelfrunError.errorAmount}" data-accounting-precision="4"></td>
					  	</tr>
					  	<tr>
					  		<td class="text-right"><strong>实际金额:</strong></td>
					  		<td data-accounting="${statementSelfrunError.actualAmount}" data-accounting-precision="4"></td>
					  	</tr>
					  	
					  		<c:if test="${statementSelfrunError.isConfirmed ==1}">
						  		<tr>
						  			<td class="text-right"><strong>处理方案:</strong></td>
						  			<td>${statementSelfrunError.exceptionHanding}</td>
						  		</tr>
					  		</c:if>
					  		<%-- <c:if test="${statementSelfrunError.isConfirmed==1}"> --%>
	    							
	    						<tr>
						  			<td class="text-right"></td>
						  		</tr>
	    					<%-- </c:if>	 --%>			  	
					  </tbody>
					  
					</table>
					
					<div class="panel-footer"></div>
				 </div>
				 <div class="tab-pane" id="history">
					<iframe id="versionFrame"   name="versionFrame"  
									scrolling="no" frameborder="no" width="100%"></iframe>
				 </div>
			</div> 
		</div> 
	</div>
	<script type="text/javascript" src="${staticPath}/js/list.js"></script>
	<script src="${staticPath}/lib/datetimepicker/0.0.11/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
	<script src="${staticPath}/lib/datetimepicker/0.0.11/js/locales/bootstrap-datetimepicker.zh-CN.js" type="text/javascript"></script>
	<script src="${staticPath}/lib/chosen/1.1.0/chosen.jquery.js" type="text/javascript"></script>
	<script src="${staticPath}/js/ossp-jquery-chosen.js" type="text/javascript"></script>
	<script src="${staticPath}/lib/accounting/0.3.2/accounting.min.js" type="text/javascript"></script>	
</body>
</html>